<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QAbstractFormBuilder Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QAbstractFormBuilder Class Reference<br /><sup><sup>[<a href="qtdesigner.html">QtDesigner</a> module]</sup></sup></h1><p>The QAbstractFormBuilder class provides a default implementation for classes that create user interfaces at run-time. <a href="#details">More...</a></p>
<p>Inherited by <a href="qformbuilder.html">QFormBuilder</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qabstractformbuilder.html#QAbstractFormBuilder">__init__</a></b> (<i>self</i>)</li><li><div class="fn" />QWidget <b><a href="qabstractformbuilder.html#load">load</a></b> (<i>self</i>, QIODevice, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qabstractformbuilder.html#save">save</a></b> (<i>self</i>, QIODevice, QWidget)</li><li><div class="fn" /><b><a href="qabstractformbuilder.html#setWorkingDirectory">setWorkingDirectory</a></b> (<i>self</i>, QDir)</li><li><div class="fn" />QDir <b><a href="qabstractformbuilder.html#workingDirectory">workingDirectory</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QAbstractFormBuilder class provides a default implementation for classes that create user interfaces at run-time.</p>
<p>QAbstractFormBuilder provides a standard interface and a default implementation for constructing forms from user interface files. It is not intended to be instantiated directly. Use the <a href="qformbuilder.html">QFormBuilder</a> class to create user interfaces from UI files at run-time. For example:</p>
<pre>         MyForm.MyForm(QWidget *parent)
             : QWidget(parent)
         {
             QFormBuilder builder;
             QFile file(":/forms/myWidget.ui");
             file.open(QFile.ReadOnly);
             QWidget *myWidget = builder.load(&amp;file, this);
             file.close();

             QVBoxLayout *layout = new QVBoxLayout;
             layout-&gt;addWidget(myWidget);
             setLayout(layout);
         }</pre>
<p>To override certain aspects of the form builder's behavior, subclass QAbstractFormBuilder and reimplement the relevant virtual functions:</p>
<ul>
<li><a href="qabstractformbuilder.html#load">load</a>() handles reading of UI format files from arbitrary QIODevices, and construction of widgets from the XML data that they contain.</li>
<li><a href="qabstractformbuilder.html#save">save</a>() handles saving of widget details in UI format to arbitrary QIODevices.</li>
<li><a href="qabstractformbuilder.html#workingDirectory">workingDirectory</a>() and <a href="qabstractformbuilder.html#setWorkingDirectory">setWorkingDirectory</a>() control the directory in which forms are held. The form builder looks for other resources on paths relative to this directory.</li>
</ul>
<p>The <a href="qformbuilder.html">QFormBuilder</a> class is typically used by custom components and applications that embed <i>Qt Designer</i>. Standalone applications that need to dynamically generate user interfaces at run-time use the <a href="quiloader.html">QUiLoader</a>, found in the <a href="qtuitools.html">QtUiTools</a> module.</p>
<p>See also <a href="qtuitools.html">QtUiTools Module</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QAbstractFormBuilder" />QAbstractFormBuilder.__init__ (<i>self</i>)</h3><p>Constructs a new form builder.</p>
<a name="//apple_ref/cpp/instm/QAbstractFormBuilder/~QAbstractFormBuilder" />
<h3 class="fn"><a name="load" /><a href="qwidget.html">QWidget</a> QAbstractFormBuilder.load (<i>self</i>, <a href="qiodevice.html">QIODevice</a>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Loads an XML representation of a widget from the given <i>device</i>, and constructs a new widget with the specified <i>parent</i>.</p>
<p>See also <a href="qabstractformbuilder.html#save">save</a>().</p>
<a name="//apple_ref/cpp/instm/QAbstractFormBuilder/save" />
<h3 class="fn"><a name="save" />QAbstractFormBuilder.save (<i>self</i>, <a href="qiodevice.html">QIODevice</a>, <a href="qwidget.html">QWidget</a>)</h3><p>Saves an XML representation of the given <i>widget</i> to the specified <i>device</i> in the standard UI file format.</p>
<p>See also <a href="qabstractformbuilder.html#load">load</a>().</p>
<a name="//apple_ref/cpp/instm/QAbstractFormBuilder/setWorkingDirectory" />
<h3 class="fn"><a name="setWorkingDirectory" />QAbstractFormBuilder.setWorkingDirectory (<i>self</i>, <a href="qdir.html">QDir</a>)</h3><p>Sets the current working directory of the form builder to the specified <i>directory</i>.</p>
<p>See also <a href="qabstractformbuilder.html#workingDirectory">workingDirectory</a>().</p>
<a name="//apple_ref/cpp/instm/QAbstractFormBuilder/workingDirectory" />
<h3 class="fn"><a name="workingDirectory" /><a href="qdir.html">QDir</a> QAbstractFormBuilder.workingDirectory (<i>self</i>)</h3><p>Returns the current working directory of the form builder.</p>
<p>See also <a href="qabstractformbuilder.html#setWorkingDirectory">setWorkingDirectory</a>().</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.7.1-5014f7c72a58 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.1</td></tr></table></div></address></body></html>